// 品牌管理模块
import request from '@/utils/axios'
import type { getHas, addTradeMark } from './type.ts'
enum API {
  TRADEMARK_URL = '/admin/product/baseTrademark/',
  ADDTRADEMARK_URL = '/admin/product/baseTrademark/save',
  UPDATETRADEMARK_URL = '/admin/product/baseTrademark/update',
  DELETE_URL = '/admin/product/baseTrademark/remove/',
}
// 获取数据
export const reqHasTardemark = (page: number, size: number) =>
  request.get<any, getHas>(API.TRADEMARK_URL + `${page}/${size}`)
export const reqAddUpadte = (data: addTradeMark) => {
  if (data.id) {
    return request.put<any, any>(API.UPDATETRADEMARK_URL, data)
  } else {
    return request.post<any, any>(API.ADDTRADEMARK_URL, data)
  }
}
export const delTardemark = (id: string) => {
  return request.delete<any, any>(API.DELETE_URL + id)
}
